/**
 * Reads the content of the file from the given location (parent folder path
 * relative to the companyhome).
 */
function main() {
	// parse json object
	var name = args.name;
	var path = args.location;

	// find parent folder scriptNode
	var pathParts = path.split("/");

	var folderNode = companyhome;

	for ( var i = 0; i < pathParts.length; i++) {
		if (pathParts[i] != "" || pathParts[i] != null) {
			// get root folder
			var deeperFolder = folderNode.childByNamePath(pathParts[i]);

			if (deeperFolder == null) {
				deeperFolder = folderNode.createFolder(pathParts[i]);
			}
			folderNode = deeperFolder;
		}
	}

	var fileToRead = folderNode.childByNamePath(name);

    model.content = fileToRead.content;
}

main();